﻿


using System;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;

namespace MF.HSD.CreateVoucherBP
{
	/// <summary>
	/// 凭证行集合 DTO :自定义的数据传输类型 
	/// 
	/// </summary>
	public  partial class VoucherLineDTO  : UFSoft.UBF.Business.DTOBase
	{
		#region Constructor
		
		/// <summary>
		/// Constructor
		/// </summary>
		public VoucherLineDTO(){
			initData();
		}
		private void initData()
		{
		
					MoneyDr = 0m; 
		
		
		
					MoneyCr = 0m; 
		
		

		}

		#endregion
		
		#region Properties
			/// <summary>
		/// LineNum (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.LineNum
		/// </summary>
		/// <value>System.String</value>
		public System.String LineNum
		{
			get	
			{	
				return (System.String)base.GetValue("LineNum",typeof(System.String));
			}

			 set	
			{
				base.SetValue("LineNum",value);
			}
		}
				/// <summary>
		/// MoneyDr (该属性可为空,但有默认值)
		/// 凭证行集合.Misc.MoneyDr
		/// </summary>
		/// <value>System.Decimal</value>
		public System.Decimal MoneyDr
		{
			get	
			{	
				return (System.Decimal)base.GetValue("MoneyDr",typeof(System.Decimal));
			}

			 set	
			{
				base.SetValue("MoneyDr",value);
			}
		}
				/// <summary>
		/// AccountCode (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.AccountCode
		/// </summary>
		/// <value>System.String</value>
		public System.String AccountCode
		{
			get	
			{	
				return (System.String)base.GetValue("AccountCode",typeof(System.String));
			}

			 set	
			{
				base.SetValue("AccountCode",value);
			}
		}
				/// <summary>
		/// Account (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.Account
		/// </summary>
		/// <value>System.String</value>
		public System.String Account
		{
			get	
			{	
				return (System.String)base.GetValue("Account",typeof(System.String));
			}

			 set	
			{
				base.SetValue("Account",value);
			}
		}
				/// <summary>
		/// 凭证集合 (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.凭证集合
		/// </summary>
		/// <value>MF.HSD.CreateVoucherBP.VoucherDTO</value>
		public MF.HSD.CreateVoucherBP.VoucherDTO VoucherDTO
		{
			get	
			{	
				return (MF.HSD.CreateVoucherBP.VoucherDTO)base.GetValue("VoucherDTO",typeof(MF.HSD.CreateVoucherBP.VoucherDTO));
			}

			 set	
			{
				base.SetValue("VoucherDTO",value);
			}
		}
				/// <summary>
		/// MoneyCr (该属性可为空,但有默认值)
		/// 凭证行集合.Misc.MoneyCr
		/// </summary>
		/// <value>System.Decimal</value>
		public System.Decimal MoneyCr
		{
			get	
			{	
				return (System.Decimal)base.GetValue("MoneyCr",typeof(System.Decimal));
			}

			 set	
			{
				base.SetValue("MoneyCr",value);
			}
		}
				/// <summary>
		/// SegmentNumber (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.SegmentNumber
		/// </summary>
		/// <value>System.String</value>
		public System.String SegmentNumber
		{
			get	
			{	
				return (System.String)base.GetValue("SegmentNumber",typeof(System.String));
			}

			 set	
			{
				base.SetValue("SegmentNumber",value);
			}
		}
				/// <summary>
		/// SegmentValue (该属性可为空,且无默认值)
		/// 凭证行集合.Misc.SegmentValue
		/// </summary>
		/// <value>System.String</value>
		public System.String SegmentValue
		{
			get	
			{	
				return (System.String)base.GetValue("SegmentValue",typeof(System.String));
			}

			 set	
			{
				base.SetValue("SegmentValue",value);
			}
		}
		
		#endregion	
		#region Multi_Fields
								
		#endregion 

		#region ModelResource
		/// <summary>
		/// 凭证行集合的显示名称资源--已经废弃，不使用.
		/// </summary>
		public string Res_TypeName {	get {return "" ;}	}
		/// <summary>
		/// LineNum的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_LineNum　{ get { return "";　}　}
		/// <summary>
		/// MoneyDr的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MoneyDr　{ get { return "";　}　}
		/// <summary>
		/// AccountCode的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_AccountCode　{ get { return "";　}　}
		/// <summary>
		/// Account的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Account　{ get { return "";　}　}
		/// <summary>
		/// 凭证集合的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_VoucherDTO　{ get { return "";　}　}
		/// <summary>
		/// MoneyCr的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MoneyCr　{ get { return "";　}　}
		/// <summary>
		/// SegmentNumber的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_SegmentNumber　{ get { return "";　}　}
		/// <summary>
		/// SegmentValue的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_SegmentValue　{ get { return "";　}　}
		#endregion 




		#region EntityData exchange
		
		#region  Do SerializeKey -ForDTOType
		//反序化Key到Data的ID中　－－由FromEntityData自动调用，不处理层次关系
		private void DeSerializeKey(VoucherLineDTOData data)
		{
		








		}

		#endregion 
		
		/// <summary>
		/// Copy Entity From EntityData
		/// </summary>
		public void FromEntityData(VoucherLineDTOData data)
		{
			this.FromEntityData(data,new Hashtable());
		}
		//used by ubf..
		public void FromEntityData(VoucherLineDTOData data,IDictionary dict)
		{
			if (data == null)
				return;
			if (dict == null ) dict = new Hashtable() ;
			dict[data] = this;
			DeSerializeKey(data);
		
			this.LineNum = data.LineNum;

			this.MoneyDr = data.MoneyDr;

			this.AccountCode = data.AccountCode;

			this.Account = data.Account;

			if (data.VoucherDTO!=null)
			{
				MF.HSD.CreateVoucherBP.VoucherDTO temp = dict[data.VoucherDTO] as MF.HSD.CreateVoucherBP.VoucherDTO ;
				if (temp == null)
				{
					temp = new MF.HSD.CreateVoucherBP.VoucherDTO();
					temp.FromEntityData(data.VoucherDTO,dict);
				}
				this.VoucherDTO = temp ;
			}
		

			this.MoneyCr = data.MoneyCr;

			this.SegmentNumber = data.SegmentNumber;

			this.SegmentValue = data.SegmentValue;

		}

		/// <summary>
		/// Create EntityData From Entity
		/// </summary>
		public VoucherLineDTOData ToEntityData()
		{
			return ToEntityData(null,new Hashtable());
		}
		/// <summary>
		/// Create EntityData From Entity - used by ubf 
		/// </summary>
		public VoucherLineDTOData ToEntityData(VoucherLineDTOData data, IDictionary dict){
			if (data == null)
				data = new VoucherLineDTOData();
			if (dict == null ) 
				dict = new Hashtable() ;
			else
            {
                if (dict.Contains(this))
                {
                    data = (VoucherLineDTOData)dict[this];
                    return data;
                }
            }
			dict[this] = data;
		
			data.LineNum = this.LineNum;

			data.MoneyDr = this.MoneyDr;

			data.AccountCode = this.AccountCode;

			data.Account = this.Account;

			if (this.VoucherDTO!=null)
			{
				data.VoucherDTO=this.VoucherDTO.ToEntityData(null,dict);
			}
		

			data.MoneyCr = this.MoneyCr;

			data.SegmentNumber = this.SegmentNumber;

			data.SegmentValue = this.SegmentValue;

			return data ;
		}

		#endregion	
	}	
	
}